<template>
  <el-dropdown @command="$emit('command', $event)">
    <span class="el-dropdown-link">
      明河
      <i class="el-icon-arrow-down el-icon--right"></i>
    </span>
    <template #dropdown>
      <el-dropdown-menu>
        <el-dropdown-item
          v-for="(item, index) in items"
          :key="index"
          v-bind="item.attrs"
          >{{ item.title }}</el-dropdown-item
        >
      </el-dropdown-menu>
    </template>
  </el-dropdown>
</template>

<script>
export default {
  name: 'GDropDown',
  props: {
    items: {
      type: Array,
      required: true
    }
  }
}
</script>
